<?php
session_start();
if(($_SESSION['datos_admin']['estado'] == "autenticado") && ($_SESSION['datos_admin']['tipo'] == 3)) {
//  -----------------------------------------------------------------------  //
//                           Jobs for Xoops 2.0x                             //
//                  By John Mordo from the myAds 2.04 Module                 //
//                    All Original credits left below this                   //
//                                                                           //
//                                                                           //
//                                                                           //
// 
// ------------------------------------------------------------------------- //
//               E-Xoops: Content Management for the Masses                  //
//                       < http://www.e-xoops.com >                          //
// ------------------------------------------------------------------------- //
// Original Author: Pascal Le Boustouller
// Author Website : pascal.e-xoops@perso-search.com
// Licence Type   : GPL
// ------------------------------------------------------------------------- //
include("header.php");

$mydirname = basename( dirname( __FILE__ ) ) ;

$myts =& MyTextSanitizer::getInstance();
$module_id = $xoopsModule->getVar('mid');

/* if (is_object($xoopsUser)) {
    $groups = $xoopsUser->getGroups();
} else {
	$groups = XOOPS_GROUP_ANONYMOUS;
}

$gperm_handler =& xoops_gethandler('groupperm');

if (isset($_POST['item_id'])) {
    $perm_itemid = intval($_POST['item_id']);
} else {
    $perm_itemid = 0;
}
//If no access
if (!$gperm_handler->checkRight("jobs_submit", $perm_itemid, $groups, $module_id)) {
    redirect_header(XOOPS_URL."/modules/$mydirname/index.php", 3, _NOPERM);
    exit();
} */



/**
 * Funci�n para borrar una oferta de trabajo
 *
 * @param int $lid: identificardor �nico de las ofertas
 * @param boolean $ok: variable que confirma la eliminacdi�n ($ok=1) o no ($ok=0) de la oferta
 */
function DelJob($lid, $ok)
{
	global $xoopsDB, $xoopsUser, $xoopsConfig, $xoopsTheme, $xoopsLogger, $mydirname;

	$result = $xoopsDB->query("select submitter, usid, photo FROM ".$xoopsDB->prefix("jobs_listing")." where lid=$lid");
	list($submitter, $usid, $photo) = $xoopsDB->fetchRow($result);
    if ($_SESSION['datos_admin']['user'] != $submitter){
	echo "<script type=\"text/javascript\">
          history.go(-1);
          </script>";
	}
	/* if ($xoopsUser) {
		$calusern = $xoopsUser->getVar("uid", "E");
		if ($usid == $calusern) { */
			if($ok==1) {
			    $xoopsDB->queryf("delete from ".$xoopsDB->prefix("jobs_listing")." where lid=$lid");
				if($photo){
					$destination = XOOPS_ROOT_PATH."/modules/$mydirname/logo_images";
					if (file_exists("$destination/$photo")) {
						unlink("$destination/$photo");
					}
				}
				redirect_header("principalempresas.php",1,_JOBS_JOBDEL);
				exit();

			} else {
				//OpenTable();
				echo "<table width='100%' border='0' cellspacing='1' cellpadding='8'><tr class='bg4'><td valign='top'>\n";
				echo "<br /><center>";
				echo "<img src=\"images/deleteuser.gif\" border=\"0\" /></a><br><br>";
				echo "<b>"._JOBS_SURDELANN2."</b><br /><br />";
			}
			echo "[ <a href=\"modjob.php?op=DelJob&amp;lid=$lid&amp;ok=1\">"._JOBS_OUI."</a> | <a href=\"principalempresas.php\">"._JOBS_NON."</a> ]<br /><br />";
			//CloseTable();
			echo "</td></tr></table>";
		}
/* 	}
}
 */

/**
 * Funci�n que muestra el formulario de modificaci�n de ofertas
 *
 * @param int $lid: n�mero de identificaci�n de la oferta
 */
function ModJob($lid)
{
	global $xoopsDB, $xoopsModule, $xoopsConfig, $xoopsModuleConfig, $xoopsUser, $xoopsTheme, $myts, $xoopsLogger, $mydirname;

	$token = $GLOBALS['xoopsSecurity']->createToken();
	
	$wysiwyg_folder = XOOPS_ROOT_PATH."/class/wysiwyg";
	
	if ( file_exists( $wysiwyg_folder ) && ($xoopsModuleConfig['koivi'] == '1')) {
	include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
	include_once XOOPS_ROOT_PATH . "/class/wysiwyg/formwysiwygtextarea.php";
	}else{
	// for XOOPS CODE  by Tom
	include_once (XOOPS_ROOT_PATH."/include/xoopscodes.php");
	}
	
	echo "<script language=\"javascript\">\nfunction CLA(CLA) { var MainWindow = window.open (CLA, \"_blank\",\"width=500,height=300,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no\");}\n</script>";

	include_once(XOOPS_ROOT_PATH."/class/xoopstree.php");
	$mytree = new XoopsTree($xoopsDB->prefix("jobs_categories"),"cid","pid");

		$sal = $xoopsDB->query("select nom_price from ".$xoopsDB->prefix("jobs_price")."");
	    list($nom_price) = $xoopsDB->fetchRow($sal);
		
//Detecci�n de errores
echo "<script type=\"text/javascript\">
function validarEmail(valor) {
 re=/^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$/
    if(!re.exec(valor))    {
//        return false;
        return true;
    }else{
        return true;
    }
}



          function verify() {
		   var a = document.add.email.value;
           var filter=/^[A-Za-z][A-Za-z0-9_]*@[A-Za-z0-9_]+.[A-Za-z0-9_.]+[A-za-z]$/;
		  
		  var precio = document.add.price.value;
		  var price1 = {$nom_price};
                var msg = \""._VALIDAR_OFERTAS."\\n__________________________________________________\\n\\n\";
                var errors = \"FALSE\";

                if (precio < price1) {
                        errors = \"TRUE\";
                        msg += \""._VALIDPRICE."\\n\";
                }
                if (document.add.title.value == \"\") {
                        errors = \"TRUE\";
                        msg += \""._VALIDCARGOSOL."\\n\";
                }
				 if (document.add.expire.value == \"0\") {
                        errors = \"TRUE\";
                        msg += \""._VALIDTIEMPO."\\n\";
                }
                 if (document.add.exprequerida.value == \"\") {
                        errors = \"TRUE\";
                        msg += \""._VALIDEXP2."\\n\";
                }
				if (document.add.town.value == \"\") {
                        errors = \"TRUE\";
                        msg += \""._VALIDSEDE."\\n\";
                }
				if (document.add.contactinfo.value == \"\") {
                        errors = \"TRUE\";
                        msg += \""._VALIDCONTACTO."\\n\";
                }				
				if (document.add.desctext.value == \"\") {
                        errors = \"TRUE\";
                        msg += \""._VALIDFUNCIONES."\\n\";
                }				
				if (document.add.requirements.value == \"\") {
                        errors = \"TRUE\";
                        msg += \""._VALIDCOMPETENCIAS."\\n\";
                }							
				if (a.length != 0) {     
                  if (!validarEmail(a)) {
			           errors = \"TRUE\";
                       msg += \""._EMAIL_ERROR."\\n\";
			     }
			 }    
												
                if (errors == \"TRUE\") {
                        msg += \"__________________________________________________\\n\\n"._VALIDAR_OFERTAS2."\\n\";
						alert(msg);			
                        return false;
                }
		  }
 </script>";

	  echo "<script type=\"text/javascript\">
	 function numeros(e) {
    tecla = (document.all) ? e.keyCode : e.which; 
    if (tecla==8) return true; 
    patron =/\d/; 
    te = String.fromCharCode(tecla); 
    return patron.test(te);
    } 
      </script>"; 
 
    $result = $xoopsDB->query("select lid, cid, title, tipocontrato, exprequerida, programa, nota, expire, type, company, desctext, requirements, tel, price, typeprice, contactinfo, date, email, submitter, usid, town, valid, photo, numvacantes from ".$xoopsDB->prefix("jobs_listing")." where lid=$lid");
    list($lid, $cide, $title, $tipocontrato, $exprequerida, $programa, $nota, $expire, $type, $company, $desctext, $requirements, $tel, $price, $typeprice, $contactinfo, $date, $email, $submitter, $usid, $town, $valid, $photo_old, $numvacantes) = $xoopsDB->fetchRow($result);
	
	// modificar solo la informacion correspondiente a la empresa que inicia la sesi�n
	
	//list($idempresa) = $xoopsDB->fetchRow($xoopsDB->query("select login FROM ".$xoopsDB->prefix("jobs_empresas")." WHERE login=".$submitter.""));
    if ($_SESSION['datos_admin']['user'] == $submitter){
	//////////////
	
	//if ($xoopsUser) {
		//$calusern = $xoopsUser->uid();
		//if ($usid == $calusern) {

			echo "<fieldset><legend style='font-weight: bold; color: #3366CC;'>"._JOBS_MODIFANN."</legend>";
			//echo "<b>"._JOBS_MODIFANN."</b><br /><br />";
	
			
		$title = $myts->makeTboxData4Edit($title);
		$tipocontrato = $myts->makeTboxData4Edit($tipocontrato);
		$exprequerida = $myts->makeTboxData4Edit($exprequerida);
		$programa = $myts->makeTboxData4Edit($programa);
		$nota = $myts->makeTboxData4Edit($nota);
		$expire = $myts->makeTboxData4Edit($expire);
		$type = $myts->makeTboxData4Edit($type);
		$company = $myts->makeTboxData4Edit($company);
		$desctext = $myts->makeTboxData4Edit($desctext);
		$requirements = $myts->makeTboxData4Edit($requirements);
		$tel = $myts->makeTboxData4Edit($tel);
		$price = $myts->makeTboxData4Edit($price);
		$contactinfo = $myts->makeTboxData4Edit($contactinfo);
		$submitter = $myts->makeTboxData4Edit($submitter);	
		$town = $myts->makeTboxData4Edit($town);
			
				
			$useroffset = "";
		    if($xoopsUser) {
				$timezone = $xoopsUser->timezone();
				if(isset($timezone)){
					$useroffset = $xoopsUser->timezone();
				}else{
					$useroffset = $xoopsConfig['default_TZ'];
				}
			}
			$dates = ($useroffset*3600) + $date;	
			$dates = formatTimestamp($date,"s");
		
		 echo "<form method=\"post\" action=\"modjob.php\" enctype=\"multipart/form-data\" name=\"add\" onsubmit=\"return verify();\">";
		    
		   echo "<table class=\"outer\"><tr>
			<td class=\"outer\">"._JOBS_ENVIADA." </td><td class=\"odd\"> $dates</td>
			</tr>";
			
			/* <tr>
			<td class=\"outer\">"._JOBS_SENDBY." </td><td class=\"odd\">$submitter</td>
			</tr> */
			echo "<tr><td width='35%' class='even'><b>"._MOSTRAR_NOMBRE."<b> </td><td class='even'>
				<input type=\"radio\" name=\"mostrar\" value=\"si\" >"._SNOMBRE."<br>
				<input type=\"radio\" name=\"mostrar\" value=\"no\" />"._NNOMBRE."
				<!--<input type=\"text\" name=\"company\" size=\"50\" maxlength=\"50\" disabled=\"disabled\"/> -->
</td></tr>";
			
			echo "<tr>
			<td class=\"outer\">"._RAZON." </td><td class=\"odd\"><input type=\"text\" name=\"company\" size=\"50\" value=\"$company\" maxlength=\"50\" readonly></td>
			</tr>";


$module_id = $xoopsModule->getVar('mid');

/* if (is_object($xoopsUser)) {
    $groups = $xoopsUser->getGroups();
} else {
	$groups = XOOPS_GROUP_ANONYMOUS;
}

$gperm_handler =& xoops_gethandler('groupperm');

if (isset($_POST['item_id'])) {
    $perm_itemid = intval($_POST['item_id']);
} else {
    $perm_itemid = 0;
}
				//If no access
if (!$gperm_handler->checkRight("jobs_premium", $perm_itemid, $groups, $module_id)) {
		    echo "<tr>
			<td width='30%' class='outer'>"._JOBS_HOW_LONG." </td><td class='odd'>$expire  "._JOBS_DAY."</td>
			</tr>";
			echo "<input type=\"hidden\" name=\"expire\" value=\"$expire\" />";
			}else{
				echo "<tr>
				<td width='30%' class='outer'>"._JOBS_HOW_LONG." </td><td class='odd'><input type=\"text\" name=\"expire\" size=\"3\" maxlength=\"3\" value=\"$expire\" />  "._JOBS_DAY."</td>
				</tr>";
			} */			
			/* echo "<tr>
			<td class=\"outer\">"._JOBS_TYPE." </td><td class=\"odd\"><select name=\"type\">";
		
			$result5=$xoopsDB->query("select nom_type from ".$xoopsDB->prefix("jobs_type")." order by nom_type");
			while(list($nom_type) = $xoopsDB->fetchRow($result5)) {
				$sel = "";
		    	if ($nom_type == $type) {
					$sel = "selected";
		    	}
				echo "<option value=\"$nom_type\" $sel>$nom_type</option>";
			}
			echo "</select></td></tr>";
			 */
			echo "<tr>
		   <td width='35%' class='outer'>"._JOBS_HOW_LONG._AST." </td><td class='odd'><input type=\"text\" name=\"expire\" size=\"3\" maxlength=\"3\" value=\"$expire\" onKeypress=\"return numeros(event);\" />  "._JOBS_DAY."</td>
		   </tr>";
			echo "<tr>
		   <td width='35%' class='outer'>N&uacute;mero de vacantes para esta solicitud </td><td class='odd'><input type=\"text\" name=\"numvacantes\" size=\"3\" maxlength=\"3\" value=\"$numvacantes\" onKeypress=\"return numeros(event);\" /> </td>
		   </tr>";
			echo "<tr>
			<td class=\"outer\">"._PERFIL_CANDIDATO._AST." </td><td class=\"odd\">";
			$mytree->makeMySelBox("title", "title", $cide);
	    	echo "</td></tr>			
			<tr>
			<td width='35%' class='outer'>"._PROGRAMA2." </td><td class='odd'><input type=\"text\" name=\"programa\" size=\"50\" maxlength=\"100\" value=\"$programa\" /></td>
			</tr><tr>
			<td class='outer'>"._CARGODE._AST." </td><td class=\"odd\"><input type=\"text\" name=\"title\" size=\"50\" maxlength=\"100\" value=\"$title\"></td>
			</tr><tr>
			<td width='35%' class='outer'>"._EXPERIENCIA._AST." </td><td class='odd'>
			<select name=\"exprequerida\">";
			
			$exprequeridalist = array(_EXP0, _EXP1, _EXP2, _EXP3, _EXP4, _EXP5, _EXP6,);
				
				foreach ($exprequeridalist as $value){
				    echo "<option value=\"{$value}\" ";
				    if ($value == $exprequerida) {
				    	$selected = "selected";
				    }else {
				        $selected = "";
				    }
				    echo "{$selected}>{$value}</option>";
				}
				
			echo "</select></td>
			</tr><tr>
			<td width='35%' class='outer'>"._TIPOCONTRATO." </td><td class='odd'><input type=\"text\" name=\"tipocontrato\" size=\"30\" value=\"$tipocontrato\" maxlength=\"30\"/></td>
			</tr><tr>
			<td class=\"outer\">"._JOBS_DESC._AST." </td><td class=\"odd\">";
			
	$wysiwyg_folder = XOOPS_ROOT_PATH."/class/wysiwyg";
	if ( file_exists( $wysiwyg_folder) && ($xoopsModuleConfig['koivi'] == '1')) {
			$wysiwyg_text_area= new XoopsFormWysiwygTextArea( _JOBS_DESC2, desctext, $desctext, '100%', '200px','small');
			echo $wysiwyg_text_area->render();
			} else {
			// add XOOPS CODE by Tom (hidden)
			ob_start();
			$GLOBALS["desctext"] = $desctext;
			xoopsCodeTarea("desctext",30,8);
			$xoops_codes_tarea = ob_get_contents();
			ob_end_clean();
			echo $xoops_codes_tarea; 
			}
			echo "</tr><tr>";
			echo "<td class=\"outer\">"._JOBS_REQUIRE._AST." </td><td class=\"odd\">";
	$wysiwyg_folder = XOOPS_ROOT_PATH."/class/wysiwyg";
	if ( file_exists( $wysiwyg_folder) && ($xoopsModuleConfig['koivi'] == '1')) {
			$wysiwyg_requirements_area= new XoopsFormWysiwygTextArea( _JOBS_REQUIRE, requirements, $requirements, '100%', '200px','small');
			echo $wysiwyg_requirements_area->render();
			} else {
			// add XOOPS CODE by Tom (hidden)
			ob_start();
			$GLOBALS["requirements"] = $requirements;
			xoopsCodeTarea("requirements",30,8);
			$xoops_codes_tarea = ob_get_contents();
			ob_end_clean();
			echo $xoops_codes_tarea; 
			}
			echo "</td></tr>";
				echo "<tr><td class=\"outer\">"._JOBS_PRICE2._AST." </td><td class=\"odd\">".$xoopsModuleConfig['monnaie']."<input type=\"text\" name=\"price\" size=\"30\" maxlength=\"12\" value=\"$price\" onKeypress=\"return numeros(event);\">
				</td></tr>";
				/* $result3 = $xoopsDB->query("select nom_price from ".$xoopsDB->prefix("jobs_price")." order by id_price");
				echo " <select name=\"typeprice\"><option value=\"$typeprice\">$typeprice</option>";
				while(list($nom_price) = $xoopsDB->fetchRow($result3)) {
					echo "<option value=\"$nom_price\">$nom_price</option>";
				}
				echo "</select>"; */
			
		echo "<tr><td class=\"outer\">"._JOBS_CONTACTINFO._AST."</td><td class=\"odd\"><textarea name=\"contactinfo\" cols=\"28\" rows=\"4\">$contactinfo</textarea>
		</td></tr><tr>
		<td class=\"outer\">"._JOBS_EMAIL." </td><td class=\"odd\"><input type=\"text\" name=\"email\" size=\"50\" value=\"$email\" maxlength=\"50\"></td>
		</tr>";
						
			/* <tr>
			<td class=\"outer\">"._JOBS_TEL." </td><td class=\"odd\"><input type=\"text\" name=\"tel\" size=\"30\" value=\"$tel\"></td>
			</tr> */
			
			echo "<tr>
			<td class=\"outer\">"._JOBS_TOWN._AST." </td><td class=\"odd\"><input type=\"text\" name=\"town\" size=\"50\" value=\"$town\" maxlength=\"50\"></td>
			</tr><tr>
				<td width='35%' class='outer'>"._NOTA." </td><td class='odd'><textarea name=\"nota\" cols=\"28\" rows=\"4\">$nota</textarea></td>
				</tr></table><br>";
			
			echo "<br>"._REQUERIDO2."<br>
			<table width='100%' class='outer' cellspacing='1'><tr>
			<td colspan=2><br><center><input type=\"submit\" value=\""._CAMBIAR."\">
			<input name=\"btncancelar\" type=\"button\" id=\"btncancelar\" onClick=\"self.location.href='principalempresas.php'\"  value=\""._CANCELAR."\">
			</center></td></tr></table>";
			echo "<input type=\"hidden\" name=\"op\" value=\"ModJobS\" />";
		
			if ($xoopsModuleConfig['moderated'] == '1') {
			    echo "<input type=\"hidden\" name=\"valid\" value=\"No\" />";
				echo "<br />"._JOBS_MODIFBEFORE."<br />";
			} else {
				echo "<input type=\"hidden\" name=\"valid\" value=\"Yes\" />";
			}

		echo "<input type=\"hidden\" name=\"token\" value=\"$token\" />";
	    	echo "<input type=\"hidden\" name=\"lid\" value=\"$lid\" />";
	    	echo "<input type=\"hidden\" name=\"date\" value=\"$date\" />";
	    	echo "<input type=\"hidden\" name=\"submitter\" value=\"$submitter\" />
			</form><br />";
		echo "</fieldset><br />"; 
    		//CloseTable();
      //  }    
	//}
	}
	else{
	 echo "<script type=\"text/javascript\">
 history.go(-1);
 </script>";
	}
}

/**
 * Funci�n para actualizar los registros de la oferta en la tabla 'jobs_listing' 
 *
 * @param int $lid
 * @param int $cat
 * @param string $title
 * @param string $tipocontrato
 * @param string $exprequerida
 * @param string $programa
 * @param string $nota
 * @param int $expire
 * @param unknown_type $type
 * @param string $company
 * @param string $desctext
 * @param string $requirements
 * @param string $tel
 * @param int $price
 * @param string $typeprice
 * @param string $contactinfo
 * @param string $date
 * @param string $email
 * @param string $submitter
 * @param string $town
 * @param string $valid
 * @param unknown_type $photo
 * @param unknown_type $photo_old
 * @param unknown_type $photoS_size
 * @param unknown_type $photoS_name
 * @param unknown_type $_FILES
 * @param unknown_type $supprim
 * @param unknown_type $mydirname
 */
function ModJobS($lid, $cat, $title, $tipocontrato, $exprequerida, $programa, $nota, $expire, $type, $company, $desctext, $requirements, $tel, $price, $typeprice, $contactinfo, $date, $email, $submitter, $town, $valid, $photo, $photo_old, $photoS_size, $photoS_name, $_FILES, $supprim, $mydirname, $numvacantes)
{
	global $xoopsDB, $xoopsConfig, $xoopsConfig, $xoopsModuleConfig, $myts, $xoopsLogger, $mydirname;

	if (!$GLOBALS['xoopsSecurity']->check(true, $_REQUEST['token'])) {
	redirect_header(XOOPS_URL."/modules/$mydirname/principalempresas.php", 3, implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()));
		}
	
		
		$destination = XOOPS_ROOT_PATH."/modules/$mydirname/logo_images";
	
	if($supprim == "yes"){
		if (file_exists("$destination/$photo_old")) {
			 unlink("$destination/$photo_old");
		}
		
		$photo_old = "";
	}
	
	$title = $myts->makeTboxData4Save($title);
	$tipocontrato = $myts->makeTboxData4Save($tipocontrato);
	$exprequerida = $myts->makeTboxData4Save($exprequerida);
	$programa = $myts->makeTboxData4Save($programa);
	$nota = $myts->makeTboxData4Save($nota);
	$expire = $myts->makeTboxData4Save($expire);
	$type = $myts->makeTboxData4Save($type);
	$company = $myts->makeTboxData4Save($company);
	$desctext = $myts->makeTboxData4Save($desctext);
	$requirements = $myts->makeTboxData4Save($requirements);
	$tel = $myts->makeTboxData4Save($tel);
	$price = $myts->makeTboxData4Save($price);
	$typeprice = $myts->makeTboxData4Save($typeprice);
	$contactinfo = $myts->makeTboxData4Save($contactinfo);
	$submitter = $myts->makeTboxData4Save($submitter);	
	$town = $myts->makeTboxData4Save($town);
	
		
    $xoopsDB->query("update ".$xoopsDB->prefix("jobs_listing")." set cid='$cat', title='$title', tipocontrato='$tipocontrato', exprequerida='$exprequerida', programa='$programa', nota='$nota', expire='$expire', type='$type', company='$company', desctext='$desctext', requirements='$requirements', tel='$tel', price='$price', typeprice='$typeprice',  contactinfo='$contactinfo', date='$date', email='$email', submitter='$submitter', town='$town', valid='$valid', photo='$photo_old', numvacantes='$numvacantes' where lid=$lid");

	redirect_header("principalempresas.php",3,_JOBS_JOBMOD2);
	exit();
}

####################################################
foreach ($HTTP_POST_VARS as $k => $v) {
	${$k} = $v;
}

$ok = isset( $_GET['ok'] ) ? $_GET['ok'] : '' ;

if(!isset($_POST['lid']) && isset($_GET['lid']) ) {
	$lid = $_GET['lid'] ;
}
if(!isset($_POST['op']) && isset($_GET['op']) ) {
	$op = $_GET['op'] ;
}

switch ($op) {

    case "ModJob":
	include(XOOPS_ROOT_PATH."/header.php");
    ModJob($lid);
	include(XOOPS_ROOT_PATH."/footer.php");
    break;
	
	case "ModJobS":
    ModJobS($lid, $cid, $title, $tipocontrato, $exprequerida, $programa, $nota, $expire, $type, $company, $desctext, $requirements, $tel, $price, $typeprice, $contactinfo, $date, $email, $submitter, $town, $valid, $photo, $photo_old, $photo_size, $photo_name, $_FILES, $supprim, $mydirname, $numvacantes);
    break;

    case "DelJob":
	include(XOOPS_ROOT_PATH."/header.php");
    DelJob($lid, $ok);
	include(XOOPS_ROOT_PATH."/footer.php");
    break;

    default:
	redirect_header("index.php",1,""._RETURNANN."");
	break;
}

 }else
{
// Usuario que no se ha logueado
echo "No tienes permiso para entrar a esta pagina...";
exit();
} 
?>
